ifeq ($(TOP_DIR),)
	ifeq ($(DAVINCI_HIAI_DKMS),y) #for DKMS
	endif
else #for CMake
	include $(FEATURE_MK_PATH)
	EXTRA_CFLAGS += $(CONFIG_DEFINES)

	ifeq ($(PRODUCT_SIDE), host)
	else
		drv_devmng-y += lpm/dms_lpm.o
		drv_devmng-y += lpm/dms_lpm_common.o
		drv_devmng-y += lpm/dms_lpm_info.o
		drv_devmng-y += lpm/dms_lpm_info_stub.o
		drv_devmng-y += lpm/dms_lpm_info_from_ipc.o
		drv_devmng-y += lpm/dms_lpm_info_from_register.o
		drv_devmng-y += lpm/dms_lpm_info_from_devinfo.o
		drv_devmng-y += lpm/dms_lpm_scan.o

		EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/dms/core
		EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/dbl/dev_urd
		EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/dms/dtm
		EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/dms/smf
		EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/dms/include
		EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/dms/lpm
		EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/dms/ipc
		EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/drv_devmng/drv_devmng_inc
		EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/inc/ascend_platform
		EXTRA_CFLAGS += -I$(TOP_DIR)/drivers/kernel/spmi_hisi
		EXTRA_CFLAGS += -DCFG_FEATURE_LPM

		ifneq ($(filter $(PRODUCT), ascend310B ascend310Bemu as31xm1 ascend310Brc ascend310Brcemu),)
			EXTRA_CFLAGS += -DCFG_FEATURE_GET_POWER_FROM_SHAREMEM
			EXTRA_CFLAGS += -DCFG_REATURE_GET_AICPU_FREQ_FORM_SHAREMEM
			EXTRA_CFLAGS += -DCFG_LPM_INFO_FROM_SHAREMEM
			EXTRA_CFLAGS += -DCFG_GET_FREQ_INFO
			EXTRA_CFLAGS += -DCFG_FEATURE_GET_TEMP_FREQ_FROM_SHAREMEM
			EXTRA_CFLAGS += -DCFG_SOC_RECONSITUTION_TEMPORARY
			EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/drv_devmng/drv_devmng_device/ascend910
		endif
		ifneq ($(filter $(PRODUCT),  ascend310Besl ascend310Brcesl),)
			EXTRA_CFLAGS += -DCFG_LPM_INFO_MAX_FREQ_STUB
			EXTRA_CFLAGS += -DCFG_LPM_INFO_STUB
			EXTRA_CFLAGS += -DCFG_SOC_RECONSITUTION_TEMPORARY
			EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/drv_devmng/drv_devmng_device/ascend910
		endif
		ifneq ($(filter $(PRODUCT), ascend610 ascend610Lite ascend610Liteesl),)
			EXTRA_CFLAGS += -DCFG_REATURE_GET_INFO_FORM_IPC
		endif
		ifneq ($(filter $(PRODUCT), ascend910B ascend920emu),)
			EXTRA_CFLAGS += -DCFG_FEATURE_GET_POWER_FROM_SHAREMEM
			EXTRA_CFLAGS += -DCFG_REATURE_GET_N_DIE_TMEP_FORM_SHAREMEM
			EXTRA_CFLAGS += -DCFG_REATURE_GET_HBM_TEMP_FORM_SHAREMEM
			EXTRA_CFLAGS += -DCFG_REATURE_GET_HBM_FREQ_FORM_IPC
			EXTRA_CFLAGS += -DCFG_REATURE_GET_AICPU_FREQ_FORM_SHAREMEM
			EXTRA_CFLAGS += -DCFG_LPM_INFO_FROM_SHAREMEM
			EXTRA_CFLAGS += -DCFG_GET_FREQ_INFO
			EXTRA_CFLAGS += -DCFG_SUPPORT_NDIE
			EXTRA_CFLAGS += -DCFG_SOC_RECONSITUTION_TEMPORARY
			EXTRA_CFLAGS += -DCFG_SOC_GET_HBM_FREQ_TEMPORARY
			drv_devmng-y += lpm/dms_lpm_pass_through_mcu.o
			EXTRA_CFLAGS += -DCFG_FEATURE_PASS_THROUGH_MCU_BY_IMU
			EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/drv_devmng/drv_devmng_device/ascend910
		endif
		ifneq ($(filter $(PRODUCT), ascend920esl),)
			EXTRA_CFLAGS += -DCFG_LPM_INFO_MAX_FREQ_STUB
			EXTRA_CFLAGS += -DCFG_LPM_INFO_STUB
			EXTRA_CFLAGS += -DCFG_SUPPORT_NDIE
			EXTRA_CFLAGS += -DCFG_SOC_RECONSITUTION_TEMPORARY
			EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/drv_devmng/drv_devmng_device/ascend910
		endif
		ifneq ($(filter $(PRODUCT), ascend910),)
			EXTRA_CFLAGS += -DCFG_FEATURE_GET_POWER_FROM_IPC
			EXTRA_CFLAGS += -DCFG_REATURE_GET_N_DIE_TMEP_FORM_IPC
			EXTRA_CFLAGS += -DCFG_REATURE_GET_HBM_TEMP_FORM_IPC
			EXTRA_CFLAGS += -DCFG_REATURE_SOC_MAX_TEMP_FORM_IPC
			EXTRA_CFLAGS += -DCFG_REATURE_GET_DDR_FREQ_FORM_IPC
			EXTRA_CFLAGS += -DCFG_REATURE_GET_HBM_FREQ_FORM_IPC
			EXTRA_CFLAGS += -DCFG_REATURE_GET_AICORE_FREQ_FORM_IPC
			EXTRA_CFLAGS += -DCFG_REATURE_GET_AICPU_FREQ_FORM_IPC
			EXTRA_CFLAGS += -DCFG_FEATURE_GET_TV_FROM_IPC
			EXTRA_CFLAGS += -DCFG_LPM_INFO_MAX_FREQ_STUB
			EXTRA_CFLAGS += -DCFG_LPM_INFO_FROM_IPC
			EXTRA_CFLAGS += -DCFG_UTIL_BY_CALCULATE
			EXTRA_CFLAGS += -DCFG_DIE_HBM_TEMP
			EXTRA_CFLAGS += -DCFG_GET_FREQ_INFO
			EXTRA_CFLAGS += -DCFG_SUPPORT_NDIE
			drv_devmng-y += lpm/dms_lpm_pass_through_mcu.o
			EXTRA_CFLAGS += -DCFG_FEATURE_PASS_THROUGH_MCU_BY_IMU
			EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/drv_devmng/drv_devmng_device/ascend910
		endif
		ifneq ($(filter $(PRODUCT), ascend610 ascend610Lite ascend610Liteesl bs9sx1a ascend310p helper310p),)
			EXTRA_CFLAGS += -DCFG_REATURE_SOC_MAX_TEMP_FORM_IPC
			EXTRA_CFLAGS += -DCFG_REATURE_GET_VECTOR_FREQ_FORM_IPC
			EXTRA_CFLAGS += -DCFG_REATURE_GET_DDR_FREQ_FORM_IPC
			EXTRA_CFLAGS += -DCFG_REATURE_GET_AICORE_FREQ_FORM_IPC
			EXTRA_CFLAGS += -DCFG_REATURE_GET_AICPU_FREQ_FORM_IPC
			EXTRA_CFLAGS += -DCFG_FEATURE_GET_TV_FROM_IPC
			EXTRA_CFLAGS += -DCFG_LPM_INFO_MAX_FREQ_STUB
			EXTRA_CFLAGS += -DCFG_LPM_INFO_FROM_IPC
			EXTRA_CFLAGS += -DCFG_UTIL_BY_CALCULATE
			EXTRA_CFLAGS += -DCFG_FREQ_FROM_IPC
			EXTRA_CFLAGS += -DCFG_LPM_INFO_FROM_LP
			EXTRA_CFLAGS += -DCFG_COMPUTE_CAPA_ALLOCAT
			EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/drv_devmng/drv_devmng_device/ascend910
		endif
		ifneq ($(filter $(PRODUCT), ascend610 ascend610Lite ascend610Liteesl bs9sx1a),)
			EXTRA_CFLAGS += -DCFG_FEATURE_FORCE_NO_SCAN
			EXTRA_CFLAGS += -DCFG_SOC_RECONSITUTION_TEMPORARY
		endif
		ifneq ($(filter $(PRODUCT), ascend310 ascend310rc ),)
			EXTRA_CFLAGS += -DCFG_FEATURE_GET_POWER_FROM_SHAREMEM
			EXTRA_CFLAGS += -DCFG_REATURE_GET_AICPU_FREQ_FORM_SHAREMEM
			EXTRA_CFLAGS += -DCFG_REATURE_SOC_MAX_TEMP_FORM_IPC
			EXTRA_CFLAGS += -DCFG_REATURE_GET_DDR_FREQ_FORM_SHAREMEM
			EXTRA_CFLAGS += -DCFG_LPM_INFO_MAX_FREQ_STUB
			EXTRA_CFLAGS += -DCFG_LPM_INFO_FROM_DEVINFO
			EXTRA_CFLAGS += -DCFG_LPM_INFO_FROM_REGISTER
			EXTRA_CFLAGS += -DCFG_LPM_INFO_FROM_PMU
			EXTRA_CFLAGS += -DCFG_FREQ_FROM_DEVINFO
			EXTRA_CFLAGS += -DCFG_UTIL_FROM_IPC
			EXTRA_CFLAGS += -DCFG_GET_TSENSOR_INFO
			EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/drv_devmng/drv_devmng_device/ascend310
			EXTRA_CFLAGS += -I$(DRIVER_KERNEL_DIR)/src/drv_devmng/drv_devmng_device/ascend310/mini

			drv_devmng-y += lpm/dms_lpm_info_from_pmu.o
		endif
	endif
endif
